home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / NT / CODE / CHAP14 / MTDEMO / MTDEMO.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.0 KB  |  46 lines

  1. //***********************************************************************
  2. //
  3. //  MTDemo.cpp
  4. //
  5. //***********************************************************************
  6.  
  7. #include <afxwin.h>
  8. #include <afxext.h>
  9. #include <afxmt.h>
  10. #include "Resource.h"
  11. #include "MTDemo.h"
  12. #include "MainFrame.h"
  13. #include "MTDoc.h"
  14. #include "MTView.h"
  15.  
  16. CMTApp myApp;
  17.  
  18. BEGIN_MESSAGE_MAP (CMTApp, CWinApp)
  19.     ON_COMMAND (ID_FILE_OPEN, CWinApp::OnFileOpen)
  20. END_MESSAGE_MAP ()
  21.  
  22. BOOL CMTApp::InitInstance ()
  23. {
  24.     SetRegistryKey ("Programming Windows 95 with MFC");
  25.     LoadStdProfileSettings ();
  26.  
  27.     CSingleDocTemplate* pDocTemplate;
  28.     pDocTemplate = new CSingleDocTemplate (
  29.         IDR_MAINFRAME,
  30.         RUNTIME_CLASS (CMTDoc),
  31.         RUNTIME_CLASS (CMainFrame),
  32.         RUNTIME_CLASS (CMTView)
  33.     );
  34.  
  35.     AddDocTemplate (pDocTemplate);
  36.  
  37.     CCommandLineInfo cmdInfo;
  38.     ParseCommandLine (cmdInfo);
  39.  
  40.     if (!ProcessShellCommand (cmdInfo))
  41.         return FALSE;
  42.  
  43.     m_pMainWnd->DragAcceptFiles ();
  44.     return TRUE;
  45. }
  46.